﻿package mortal.game.view.guild.cellrender
{
    import Message.DB.Tables.*;
    import com.mui.controls.*;
    import extend.language.*;
    import flash.text.*;
    import mortal.common.global.*;
    import mortal.component.gconst.*;
    import mortal.game.resource.*;
    import mortal.game.view.common.*;

    public class GuildBuildingIconListCellRenderer extends GCellRenderer
    {
        private var _bg:GBitmap;
        private var _icon:GImageBitmap;
        private var _name:GTextFiled;

        public function GuildBuildingIconListCellRenderer()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._bg = UIFactory.gBitmap(ImagesConst.guildOneBuidlingBg, 3, 20, this);
            this._icon = UIFactory.gImageBitmap(ImagesConst.GuildBuilding_1_1, 16, 9, this);
            var _loc_1:* = GlobalStyle.textFormatPutong;
            _loc_1.align = TextFormatAlign.CENTER;
            this._name = UIFactory.textField("" + Language.getString(71083), 15, 113, 87, 22, this, _loc_1);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._bg.dispose(param1);
            this._icon.dispose(param1);
            this._name.dispose(param1);
            return;
        }// end function

        override public function get data() : Object
        {
            return super.data;
        }// end function

        override public function set data(param1:Object) : void
        {
            super.data = param1;
            var _loc_2:* = param1 as TGuildStructureConfig;
            if (_loc_2)
            {
                this._name.text = _loc_2.structureLevel + Language.getString(71084) + GuildConst.getBuildingNameByType(_loc_2.structureType);
            }
            return;
        }// end function

    }
}
